<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title>Bugs - Safari - IFrame Focus</title>
	<script type="text/javascript">

function Focus()
{
	var eIFrame = document.getElementById('xEditArea') ;

	if ( navigator.userAgent.indexOf( 'Safari' ) >= 0 )
		eIFrame.focus() ;					// This is the Safari way (only).
	else
		eIFrame.contentWindow.focus() ;		// This one is not supported by Safari (another bug? or maybe this is the reason for the focus bug?)
}

	</script>
</head>
<body>
	<iframe id="xEditArea" src="editarea.html" width="100%" height="200" frameborder="1"></iframe>
	<br />
	<br />
	<ul>
		<li>Click in the above editing area (in the middle of the text), or even select part
			of it.</li>
		<li>Click in the following input field to remove the focus from the editing area.</li>
		<li>Click the "Focus" button to set the focus in the editing area again.</li>
	</ul>
	<p>
		<input type="text" value="Simple input field" /><br />
		<input type="button" value="Focus" onclick="Focus();" />
	</p>
	<p>
		Expected results: The editing area must have the same selection (or caret position)
		that was defined when it lost the focus. (Works well on Firefox 1.5 and Opera 9)</p>
	<p>
		Actual results: The editing area gets the focus, but the selection is lost, and
		the caret is placed in the beginning of the text.</p>
</body>
</html>
